#include <iostream>
#include <typeinfo>
#include <memory>
#include "conversion.h"
#include "type_info.h"

using namespace iloki;

class a {};
class b : public a {};

int main() {
	a a1, a2;
	b b1;
	//std::auto_ptr<a> pa(new b);
	a *pb = new b;

	// Class conversion test.
	std::cout<<"Begin iloki::conversion(T, U) self test."<<std::endl;
	if (conversion<b, a>::exists) {
		std::cout<<"The have relation ship."<<std::endl;
	}
	else {
		std::cout<<"They don't have any relationship."<<std::endl;
	}

	// Class type_info test.
	std::cout<<"Begin iloki::type_info self test."<<std::endl;
	type_info ti_a1(typeid(a1)), ti_a2(typeid(a2));
	type_info ti_b(typeid(b)), ti_pa(typeid(*pb));

	std::cout<<ti_a1.name()<<std::endl;
	std::cout<<ti_a2.name()<<std::endl;
	std::cout<<ti_b.name()<<std::endl;
	std::cout<<ti_a1.before(ti_b)<<std::endl;	
	std::cout<<(typeid(ti_b) == ti_a1)<<std::endl;
	std::cout<<(ti_a1 == ti_a2)<<std::endl;
	return 0;
}
